home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / dev / basic / ace24dist.lha / ace24.lha / include / ace / acedef.h next >
C/C++ Source or Header  |  1996-09-11  |  2KB  |  73 lines

  1. #ifndef ACEDEF_H
  2. #define ACEDEF_H 1
  3.  
  4. /*
  5. ** Note: Fixed the tagmacros, they where totaly wrong
  6. **       Sorry about that, I also added some text on
  7. **       how to use the macros.
  8. **       Date: 10/08/95   Nils Sjoholm
  9. **
  10. **
  11. */
  12. /*   Some useful defines for ACE Basic  */
  13.  
  14. #ifndef EXEC_TYPES_H        /* These constants are also defined in exec/types.h. */
  15. Const NULL = 0&
  16. Const TRUE = -1&
  17. Const FALSE = 0&
  18. #endif
  19.  
  20. /*   For drawing boxes and lines    */
  21. #define BOX(x1,y1,x2,y2)  LINE(x1,y1)-(x2,y2),,B
  22. #define BOXF(x1,y1,x2,y2)  LINE(x1,y1)-(x2,y2),,BF
  23. #define DRAWLINE(x1,y1,x2,y2) LINE(x1,y1)-(x2,y2)
  24.  
  25. /*   Some gadgets defines           */
  26. #define TEXTGADGET(num,status,default,x1,y1,x2,y2)  GADGET num,status,default,(x1,y1)-(x1+x2,y1+y2),BUTTON
  27. #define STRGADGET(num,status,default,x1,y1,x2,y2)   GADGET num,status,default,(x1,y1)-(x1+x2,y1+y2),STRING
  28. #define INTGADGET(num,status,default,x1,y1,x2,y2)   GADGET num,status,default,(x1,y1)-(x1+x2,y1+y2),LONGINT
  29. #define SLIDERXGADGET(num,status,default,x1,y1,x2,y2) GADGET num,status,default,(x1,y1)-(x1+x2,y1+y2),POTX
  30. #define SLIDERYGADGET(num,status,default,x1,y1,x2,y2) GADGET num,status,default,(x1,y1)-(x1+x2,y1+y2),POTY
  31.  
  32. /*   Some misc defines for windows, printing and drawing  */
  33. #define OPENW(num,titel,x1,y1,x2,y2) WINDOW num,titel,(x1,y1)-(x2,y2)
  34. #define PRINTAT(x,y,text) PENUP : SETXY x,y : PRINT text
  35. #define SETRGB(num,r,g,b) PALETTE num,r/15,g/15,b/15
  36. #define RAYTO(x,y) a= XCOR : b= YCOR : PENDOWN : LINE(a,b)-(x,y): PENUP : SETXY a,b
  37. #define MOVETO(x,y) PENUP : SETXY x,y
  38.  
  39. #define CHECKMARK SPACE$(CheckPlace)
  40.  
  41. /* To use this tagmacros do like this
  42.    DECLARE STRUCT TagItem   *tag,  *gadtags
  43.    You mast have tag here gadtags is just an example
  44.  
  45.    Then do like this
  46.  
  47.    SetUpTags(gadtags,9)
  48.    IF gadtags <> NULL THEN
  49.       tag = gadtags
  50.       SetTag(SomeTag,sometagdata)
  51.       SetTag(just keep ON going)
  52.       ......
  53.       SetTagEnd
  54.    END IF
  55.  
  56.    Remember that macros are CASE-sensitive
  57.    Don't forget to DECLARE AllocateTagItems and FreeTagItems
  58.    and free the tags when you don't need them anymore.
  59.  
  60.    Good luck   Nils Sjoholm
  61.  
  62. */
  63.  
  64. #define SetUpTags(tagname,num) tagname = AllocateTagItems(num)
  65. #define SetTag(tagvalue,tagdata) tag->ti_Tag = tagvalue \
  66. : tag->ti_Data = tagdata \
  67. : tag = tag + SIZEOF(TagItem)
  68.  
  69. #define SetTagEnd tag->ti_Tag = TAG_DONE
  70.  
  71. #endif
  72.  
  73.